package com.android.smsmessing.adapter;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;

import com.android.smsmessing.R;

public class SendSMSAdapter extends BaseAdapter {
    private LayoutInflater mInflater = null;
	
	public SendSMSAdapter(Context c){
		mInflater = (LayoutInflater) c
		.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 1;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	
	private static class ViewHolder {
		EditText txtSendMessage;
		Button btnSend;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder = null;
    	if (convertView == null) {
			holder = new ViewHolder();
			convertView = mInflater.inflate(R.layout.sms_send, null);
			holder.txtSendMessage = (EditText) convertView.findViewById(R.id.txtSendMessage);
			holder.btnSend = (Button) convertView.findViewById(R.id.btnSend);
    	}else{
    		holder = (ViewHolder) convertView.getTag();
    	}
    	convertView.setTag(holder);
        return convertView;
	}

}
